#ifndef RATECALIBRATETABLEMODEL_H
#define RATECALIBRATETABLEMODEL_H

#include <QAbstractTableModel>
#include "modulehplcpumpdefine.h"

class RateCalibrateTableModel : public QAbstractTableModel
{
    Q_OBJECT

public:
    RateCalibrateTableModel(QObject *parent = nullptr);
    RateCalibrateTableModel(const QList<hplc::PumpRateCalibData> &table, QObject *parent = nullptr);

    int rowCount(const QModelIndex &parent) const override;
    int columnCount(const QModelIndex &parent) const override;
    QVariant data(const QModelIndex &index, int role) const override;
    QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
    Qt::ItemFlags flags(const QModelIndex &index) const override;
    bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
    bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
    bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
    const QList<hplc::PumpRateCalibData> &getTable() const;
    void setTable(QList<hplc::PumpRateCalibData> &table);

private:
    QList<hplc::PumpRateCalibData>  m_table;
};

#endif // RATECALIBRATETABLEMODEL_H
